<!-- 部门分析- 该部门该类物料损益分析 -->
<template>
  <div class="clas_All">
    <!-- <el-form class="const_top" :model="queryParams" size="small" :inline="true">
      <el-row>
        <el-col style="padding: 10px" :span="24">
          <el-form-item prop="" style="height: 40px">
            <el-date-picker
              clearable
              v-model="queryParams.createdTime"
              type="date"
              value-format="yyyy-MM-dd"
              placeholder="请选择创建时间"
            >
            </el-date-picker>
          </el-form-item>
          <el-form-item prop="" style="height: 40px">
            <el-select
              v-model="queryParams.revision"
              placeholder="1号至10号"
              clearable
            >
              <el-option
                v-for="dict in examineOption"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              />
            </el-select>
          </el-form-item>
          <el-form-item prop="计量口径" style="height: 40px"> </el-form-item>
          <el-form-item>
            <el-button type="primary" size="mini" @click="handleQuery"
              >查询
            </el-button>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form> -->
    <el-table :data="tableData">
      <el-table-column align="center" prop="pname" label="原料类别">
      </el-table-column>
      <el-table-column align="center" label="实际成本/元">
        <el-table-column align="center" prop="realCostCurrent" label="本期">
        </el-table-column>
        <el-table-column align="center" prop="realCostUpper" label="上期">
        </el-table-column>
      </el-table-column>
      <el-table-column align="center" label="标准成本/元">
        <el-table-column align="center" prop="standardCostCurrent" label="本期">
        </el-table-column>
        <el-table-column align="center" prop="standardCostUpper" label="上期">
        </el-table-column>
      </el-table-column>
      <el-table-column align="center" label="损益金额/元">
        <el-table-column align="center" prop="prolossCostCurrent" label="本期">
        </el-table-column>
        <el-table-column align="center" prop="prolossCostUpper" label="上期">
        </el-table-column>
      </el-table-column>
      <el-table-column align="center" label="损益率">
        <el-table-column align="center" prop="prolossRateCurrent" label="本期">
        </el-table-column>
        <el-table-column align="center" prop="prolossRateUpper" label="上期">
        </el-table-column>
      </el-table-column>
      <el-table-column align="center" label="损益诊断"> </el-table-column>
      <el-table-column align="center" label="重点物料"> </el-table-column>
      <el-table-column align="center" label="重点物料说明"> </el-table-column>
      <el-table-column label="操作" props="" align="center">
        <template slot-scope="scope">
          <div>
            <el-button size="mini" type="text" @click="Gospu(scope.row)">
              该spu各部门用料sku明细
            </el-button>
          </div>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import {
  stapprolossDept,
  stapprolossDeptCate,
  stapprolossInfo,
} from "@/api/system/cost";
export default {
  data() {
    return {
      queryParams: {},
      examineOption: [],
      tableData: [],
    };
  },
  created() {
    this.queryParams.shopCode = this.$route.query.shopCode;
    this.queryParams.deptCode = this.$route.query.deptCode;
    this.queryParams.pandianCode = this.$route.query.pandianCode;
    this.queryParams.stapTypeCode = this.$route.query.stapTypeCode;
    // console.log(this.queryParams);
    this.getList();
  },
  methods: {
    handleQuery() {},
    getList() {
      stapprolossDeptCate(this.queryParams).then((res) => {
        // console.log(res);
        if (res.code == 200) this.tableData = res.data;
      });
    },
    Gospu(v) {
      // console.log(v);
      this.$router.push({
        path: "/ProfitDetail",
        query: {
          pandianCode: this.queryParams.pandianCode,
          shopCode: v.shopCode,
          deptCode: v.deptCode,
          stapCode: v.stapCode,
          stapTypeCode: v.stapType,
        },
      });
    },
  },
  //   ProfitDetail   // /sectoralAnalysis/ProfitDepartment/ProfitDetail  该spu各部门用料sku明细
};
</script>

<style lang="scss" scoped>
.clas_All {
  margin: 20px;
}
</style>
